<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/8 0008
 * Time: 上午 9:26
 */

require APPPATH."/models/DbCommon.php";

class Order extends DbCommon
{
    function __construct()
    {
        parent::__construct();
    }

    static protected $table = "payment_order";
    static function save($data,$where=''){
        if(!$where){
            return self::me()->db->insert(self::$table,$data);
        }else{
            return self::me()->db->update_string(self::$table, $data, $where);
        }
    }

    static function findById($id){
        return self::db()->where('id', $id)->get(self::$table)->row();
    }

    static function findByCode($code){
        return self::db()->where('code', $code)->get(self::$table)->row();
    }


}